'''
Created on 28.02.2010

@author: FlashDeveloper
'''
import unittest
import mp3work
import mp3work.ID3
from mp3work import mp3utils
from mp3work.ID3 import ID3

workingFile = u"F:/music/tests/10 trac 10.mp3"


class TestSettingArt(unittest.TestCase):
    
    NEWARTIST = "test write new art"

    def setUp(self):
        self.orignId3info = ID3( workingFile )
        self.id3info =  ID3( workingFile )
        self.assertNotEqual( self.orignId3info.artist, TestSettingArt.NEWARTIST )
        self.builder = mp3utils.UpdateArtistBuilder(TestSettingArt.NEWARTIST)
        self.builder.start()
        print workingFile  
        pass
    
    def tearDown(self):
        self.builder.complete()
        self.orignId3info.write()
        del self.orignId3info
        del self.id3info        
        pass
    
    def testTestSettingArt(self):
        self.builder.build( self.id3info )  
        newid3info = ID3( workingFile )
        self.assertNotEqual(self.orignId3info.artist,newid3info.artist)
        pass


if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testTestSettingArt']
    unittest.main()